package myJs.myPkg

import slinky.readwrite.ObjectOrWritten

import scala.scalajs.js
import scala.scalajs.js.{Date, |}
import scala.scalajs.js.annotation.JSImport

/**
 * Created by yz on 9/12/2022
 */

@js.native
trait MomentT extends js.Object {

  def format(format: String): String = js.native

  def isValid(): Boolean = js.native

  def toDate(): Date = js.native

}

@js.native
@JSImport("moment", JSImport.Default)
object Moment extends js.Object {

  type InputP = Date | String

  def apply(): MomentT = js.native

  def apply(inp: String): MomentT = js.native

  def apply(inp: Date): MomentT = js.native

  def apply(inp: InputP, format: String, strict: Boolean = true): MomentT = js.native

}
